package com.xq.shop.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.xq.shop.dao.IUserDAO;
import com.xq.shop.po.User;
import com.xq.shop.util.HibernateUtil;

@Repository
@SuppressWarnings("unchecked")
public class UserDAO extends BaseDAO<User> implements IUserDAO {

	@Override
	public User get(String username) {
		
		List<User> result = HibernateUtil.getTemplate().find(" from User where username=?", username);
		return result.size() > 0 ? result.get(0) : null;
	}
}
